#include "Buttons.h"
#include "BitmapFont.h"

Buttons::Buttons()
{

}

Buttons::~Buttons()
{

}

void Buttons::Render()
{
	SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
	BitmapFont temp;
	temp.Initialize();

	if (m_bSelected)
		pGraphics->DrawTexture(m_hImage[2], SGD::Point(m_ptPosition.x + 20, m_ptPosition.y), 0.0f);
	else if (m_bHighlight)
		pGraphics->DrawTexture(m_hImage[1], SGD::Point(m_ptPosition.x + 20, m_ptPosition.y), 0.0f);
	else
		pGraphics->DrawTexture(m_hImage[0], m_ptPosition, 0.0f, {}, SGD::Color(100, 255, 255, 255));

	if (m_bHighlight)
		temp.Draw(&m_szText, (int)m_ptPosition.x + 40 + 20, (int)m_ptPosition.y + 10, .75f, SGD::Color(255, 255, 0));
	else
		temp.Draw(&m_szText, (int)m_ptPosition.x + 40, (int)m_ptPosition.y + 10, .75f, SGD::Color(100, 255, 255, 255));
}

void Buttons::LoadImage(std::string filename)
{
	m_hImage.push_back(SGD::GraphicsManager::GetInstance()->LoadTexture(filename.c_str()));
}